package com.eduran.test.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.Map;

@Controller
public class HelloController{
    @RequestMapping("/welcome/{firstname}/{lastname}")
    public ModelAndView helloWorld(@PathVariable Map<String,String> parthVars){
        String firstname = parthVars.get("firstname");
        String lastname = parthVars.get("lastname");
        ModelAndView model = new ModelAndView("HelloPage");
        model.addObject("msg", "Merhaba " + firstname + " " + lastname);
        return model;
    }


}
